/**
	* 数据字典 mixin
	*/
export default {

	install(Vue){
		Vue.mixin({
			data(){
				return {
					listTableTop: null
				}
			},
			created() {

				if(this.$refs.listTable){
					this.$nextTick(() => {
						this.listTableTop = this.$refs.listTable.$el.offsetTop;
					});
				}


			},
			activated() {
				if(this.$refs.listTable){
					this.$nextTick(() => {
						this.$refs.listTable.doLayout()
					});
				}
			},
			watch:{
				showSearch(val){
					if(this.$refs.listTable){
						this.$nextTick(() => {
							this.listTableTop = this.$refs.listTable.$el.offsetTop;
						});
					}
				}
			},
			computed:{
				tableHeight(){
					if(this.listTableTop){
						let appHeight = this.$store.state.app.appSize.height || window.innerHeight;
						let height = appHeight - this.listTableTop - 160;
						return height;
					}
					return null;
				},
				dialogTableHeight(){
					if(this.listTableTop){
						let appHeight = this.$store.state.app.appSize.height || window.innerHeight;
						let height = appHeight - this.listTableTop - 300;
						return height;
					}
					return null;
				},
			}
		});
	}
}
